package io.renren.sf.service.impl;

import io.renren.sf.entity.CbBasisStrokesEntity;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import io.renren.sf.dao.CbBrushDao;
import io.renren.sf.entity.CbBrushEntity;
import io.renren.sf.service.CbBrushService;


@Service("cbBrushService")
public class CbBrushServiceImpl extends ServiceImpl<CbBrushDao, CbBrushEntity> implements CbBrushService {

    @Override
    public CbBrushEntity getBrushByWordId(Long wordId) {
        CbBrushEntity cbBrushEntity = baseMapper.getBrushByWordId(wordId);

        List<CbBasisStrokesEntity> strokes = baseMapper.getBasisStrokesByWordId(wordId);
        cbBrushEntity.setChildren(strokes);

        return cbBrushEntity;
    }

}